package com.jiangyg.mall.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 类描述：权限关联表
 *
 * @author jiangyg
 * @version 2.0
 * @date 2020-08-04
 */
@Data
@NoArgsConstructor
@TableName("t_sys_permission")
@EqualsAndHashCode(callSuper = true)
public class Permission extends BaseEntity {

    private static final long serialVersionUID = -3997436188974493840L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 关联ID
     */
    @TableField("reference_id")
    private Long referenceId;

    /**
     * 操作ID
     */
    @TableField("resource_id")
    private Long resourceId;

    /**
     * 权限类型 1、用户 2、角色 3、部门
     */
    @TableField("type")
    private String type;

    public Permission(Long referenceId, Long resourceId, String type) {
        this.referenceId = referenceId;
        this.resourceId = resourceId;
        this.type = type;
    }
    
}
